@echo off
rem script to create a HAG SDK from the current build

if NOT "%1"=="" (
	GOTO :ARGSOK
)

:ERROR
echo usage: CreateSDK <sdk version name>
GOTO :EOF

:ARGSOK

set TARGETDIR=%SPOCLIENT%\Solutions\HAG\%1

del /Q %TARGETDIR%
mkdir %TARGETDIR%

copy "HAG Release Notes.docx" %TARGETDIR%
copy "GPIOButtonInputProvider.cs" %TARGETDIR%
copy "EMIC HAG Hardware Manual.pdf" %TARGETDIR%
copy "hag-users-manual.docx" %TARGETDIR%

mkdir %TARGETDIR%\NETMFSDK
copy %SPOCLIENT%\BuildOutput\public\debug\Server\ISO\MicroFrameworkSDK %TARGETDIR%\NETMFSDK

mkdir %TARGETDIR%\IOBus
mkdir %TARGETDIR%\IOBus\debug
mkdir %TARGETDIR%\IOBus\debug\be
mkdir %TARGETDIR%\IOBus\debug\le
mkdir %TARGETDIR%\IOBus\release
mkdir %TARGETDIR%\IOBus\release\be
mkdir %TARGETDIR%\IOBus\release\le
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBus\IOBus\bin\debug %TARGETDIR%\IOBus\debug
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBus\IOBus\bin\debug\be %TARGETDIR%\IOBus\debug\be
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBus\IOBus\bin\debug\le %TARGETDIR%\IOBus\debug\le
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBus\IOBus\bin\release %TARGETDIR%\IOBus\release
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBus\IOBus\bin\release\be %TARGETDIR%\IOBus\release\be
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBus\IOBus\bin\release\le %TARGETDIR%\IOBus\release\le

mkdir %TARGETDIR%\IOBusClasses
mkdir %TARGETDIR%\IOBusClasses\debug
mkdir %TARGETDIR%\IOBusClasses\debug\be
mkdir %TARGETDIR%\IOBusClasses\debug\le
mkdir %TARGETDIR%\IOBusClasses\release
mkdir %TARGETDIR%\IOBusClasses\release\be
mkdir %TARGETDIR%\IOBusClasses\release\le
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBusClasses\IOBusClasses\bin\debug %TARGETDIR%\IOBusClasses\debug
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBusClasses\IOBusClasses\bin\debug\be %TARGETDIR%\IOBusClasses\debug\be
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBusClasses\IOBusClasses\bin\debug\le %TARGETDIR%\IOBusClasses\debug\le
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBusClasses\IOBusClasses\bin\release %TARGETDIR%\IOBusClasses\release
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBusClasses\IOBusClasses\bin\release\be %TARGETDIR%\IOBusClasses\release\be
copy /Y %SPOCLIENT%\Solutions\HAG\DeviceCode\HAG_IOBUS\targets\dotnetmf\api\IOBusClasses\IOBusClasses\bin\release\le %TARGETDIR%\IOBusClasses\release\le

mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\be
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\le
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\be
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\le
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\dll\Microsoft.SPOT.Hardware.HAG.dll %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\dll\Microsoft.SPOT.Hardware.HAG.dll %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release

copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\dll\Microsoft.SPOT.Hardware.HAG.pdb %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\dll\Microsoft.SPOT.Hardware.HAG.pdb %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release

copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\dll\Microsoft.SPOT.Hardware.HAG_assemblyinfo.txt %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\dll\Microsoft.SPOT.Hardware.HAG_assemblyinfo.txt %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release

mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\be
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\be
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\pe\be\Microsoft.SPOT.Hardware.HAG.pdbx %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\be
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\pe\be\Microsoft.SPOT.Hardware.HAG.pe %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\be
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\pe\be\Microsoft.SPOT.Hardware.HAG.strings %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\be

copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\pe\be\Microsoft.SPOT.Hardware.HAG.pdbx %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\be
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\pe\be\Microsoft.SPOT.Hardware.HAG.pe %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\be
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\pe\be\Microsoft.SPOT.Hardware.HAG.strings %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\be

mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\le
mkdir %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\le
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\pe\le\Microsoft.SPOT.Hardware.HAG.pdbx %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\le
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\pe\le\Microsoft.SPOT.Hardware.HAG.pe %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\le
copy /Y %SPOCLIENT%\BuildOutput\public\debug\Client\pe\le\Microsoft.SPOT.Hardware.HAG.strings %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\debug\le

copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\pe\le\Microsoft.SPOT.Hardware.HAG.pdbx %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\le
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\pe\le\Microsoft.SPOT.Hardware.HAG.pe %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\le
copy /Y %SPOCLIENT%\BuildOutput\public\release\Client\pe\le\Microsoft.SPOT.Hardware.HAG.strings %TARGETDIR%\Microsoft.SPOT.Hardware.HAG\release\le

mkdir %TARGETDIR%\firmware
mkdir %TARGETDIR%\firmware\debug
mkdir %TARGETDIR%\firmware\release
copy /Y %SPOCLIENT%\BuildOutput\ARM\RVDS4.0\le\RAM\debug\HAG\bin %TARGETDIR%\firmware\debug
copy /Y %SPOCLIENT%\BuildOutput\ARM\RVDS4.0\le\RAM\release\HAG\bin %TARGETDIR%\firmware\release

rem zip SDK into ZIP archive
zip -v -r -9 %1.zip %TARGETDIR%
move /Y %1.zip SDKs
rd /Q /S %TARGETDIR%

:EOF
